import request from '@/utils/request'
import url from './url'

export function createUserApi(data) {
  return request({
    url: url.createUserUrl,
    method: 'post',
    data
  })
}

export function batchCreateUserApi(data) {
  return request({
    url: url.batchCreateUserUrl,
    method: 'post',
    data
  })
}

export function updateUserApi(data) {
  return request({
    url: url.updateUserUrl,
    method: 'post',
    data
  })
}

export function deleteUserApi(data) {
  return request({
    url: url.deleteUserUrl,
    method: 'post',
    data
  })
}

export function getUserListApi(data) {
  return request({
    url: url.getUserListUrl,
    method: 'get',
    params: data
  })
}

export function runUserListApi(host, data) {
  const u = 'http://' + host + ':18000' + url.runUserListUrl
  return request({
    url: u,
    method: 'post',
    data
  })
}

export function stopUserListApi(data) {
  return request({
    url: url.stopUserListUrl,
    method: 'post',
    data
  })
}

export function getUserApi(data) {
  return request({
    url: url.getUserUrl,
    method: 'get',
    params: data
  })
}

export function getUserBaseInfoApi(data) {
  return request({
    url: url.getUserBaseInfoUrl,
    method: 'get',
    params: data
  })
}

export function exportUserApi(data) {
  return request({
    url: url.exportUserUrl,
    method: 'post',
    data
  })
}

export function importUserApi(data) {
  return request({
    url: url.importUserUrl,
    method: 'post',
    data
  })
}

export function statisticsApi(data) {
  return request({
    url: url.statisticsUrl,
    method: 'get',
    data
  })
}
